package ifpb.banco.entity;

import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Vanderlan
 */
@Entity
@Table(catalog = "", schema = "VANDERLAN")
@SequenceGenerator(name = "S_CLIENTE_PK", sequenceName = "S_CLIENTE_PK") 
public class Cliente extends Identificavel{
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "COD_CLIENTE", nullable = false, precision = 0, scale = -127)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "S_CLIENTE_PK")
    protected Long id;
    @Basic(optional = false)
    @Column(nullable = false, length = 60)
    private String nome;
    @Basic(optional = false)
    @Column(nullable = false, unique=true)
    private long cpf;
    @Basic(optional = false)
    @Column(nullable = false)
    private char sexo;
    @Basic(optional = false)
    @Column(nullable = false, length = 15)
    private String rg;
    @Basic(optional = false)
    @Column(name = "ORGAO_EXPEDIDOR", nullable = false, length = 10)
    private String orgaoExpedidor;
    @Basic(optional = false)
    @Column(name = "CELULAR_1", nullable = false, length = 11)
    private String celular1;
    @Column(name = "CELULAR_2", length = 11)
    private String celular2;
    @Column(name = "E_MAIL", length = 40)
    private String eMail;
    @Column(length = 200)
    private String observacao;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "codCliente")
    private Collection<Hospedagem> hospedagemCollection;

    public Cliente() {
    }

    public Cliente(Long codCliente) {
        this.id = codCliente;
    }

    public Cliente(Long codCliente, String nome, long cpf, char sexo, String rg, String orgaoExpedidor, String celular1) {
        this.id = codCliente;
        this.nome = nome;
        this.cpf = cpf;
        this.sexo = sexo;
        this.rg = rg;
        this.orgaoExpedidor = orgaoExpedidor;
        this.celular1 = celular1;
    }

    public Long getCodCliente() {
        return id;
    }

    public void setCodCliente(Long codCliente) {
        this.id = codCliente;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public long getCpf() {
        return cpf;
    }

    public void setCpf(long cpf) {
        this.cpf = cpf;
    }

    public char getSexo() {
        return sexo;
    }

    public void setSexo(char sexo) {
        this.sexo = sexo;
    }

    public String getRg() {
        return rg;
    }

    public void setRg(String rg) {
        this.rg = rg;
    }

    public String getOrgaoExpedidor() {
        return orgaoExpedidor;
    }

    public void setOrgaoExpedidor(String orgaoExpedidor) {
        this.orgaoExpedidor = orgaoExpedidor;
    }

    public String getCelular1() {
        return celular1;
    }

    public void setCelular1(String celular1) {
        this.celular1 = celular1;
    }

    public String getCelular2() {
        return celular2;
    }

    public void setCelular2(String celular2) {
        this.celular2 = celular2;
    }

    public String getEMail() {
        return eMail;
    }

    public void setEMail(String eMail) {
        this.eMail = eMail;
    }

    public String getObservacao() {
        return observacao;
    }

    public void setObservacao(String observacao) {
        this.observacao = observacao;
    }

    public Collection<Hospedagem> getHospedagemCollection() {
        return hospedagemCollection;
    }

    public void setHospedagemCollection(Collection<Hospedagem> hospedagemCollection) {
        this.hospedagemCollection = hospedagemCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cliente)) {
            return false;
        }
        Cliente other = (Cliente) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ifpb.banco.principal.entity.Cliente[ codCliente=" + id + " ]";
    }
    
}
